<?php $display = ($data->mail_sent != 1) ? '' : 'display:none';
if($data->classes_id<>"") $classcoursetyp = 'class'; else $classcoursetyp = 'course';
?>
<div class="rowG tr" style="width:1090px;">
    <div class="col col2">
        <div class="padding">
            <p><?php echo $index + 1; ?>.</p>
        </div>
    </div>
    <div class="col col4">
        <div class="padding">
            <p><?php echo $data->name; ?></p>
        </div>
    </div>
    <div class="col col4">
        <div class="padding">
            <p><?php if ($data->classes_id) echo $data->classes->class_titile; if ($data->courses_id) echo $data->courses->course_titile; ?></p>
        </div>
    </div>
    <div class="col col3">
        <div class="padding">
            <p><?php echo date('M d Y', strtotime($data->created)); ?></p>
        </div>
    </div>
    <div class="col col3">
        <div class="padding">
            <p><?php echo TimeAgo(convert_datetime($data->created)); ?></p>
        </div>
    </div>
    <div class="col col-2">
        <div class="padding10px">
            <a href="javascript:void(0);" onclick="return showQuery('open_msg_box_<?php echo $data->id; ?>')">Go To Query</a>
        </div>
        <div class="padding10px"><div  id="respond_<?php echo $data->id; ?>" <?php if ($data->mail_sent == '') { ?> style="display:none;"<?php } ?>>Responded</div><div id="unrespond_<?php echo $data->id; ?>" <?php if ($data->mail_sent == 1) { ?> style="display:none;"<?php } ?> class="blink">Unresponded</div>
        </div>
    </div>
    <div id='formResult_<?php echo $data->id; ?>' style='margin:20px;'></div>
    <div id="open_msg_box_<?php echo $data->id; ?>" style="margin: 9px 120px 0px 18px;display:none;" class="sendMessageTouserOpenBox">
        <div class="common  formElements"> 
            <h4>Query Detail</h4>
            <div class="clear"></div>
            <div class="greenBor radius4px addmarginB20">
                <div id="queryBox" class="padding20px">
                    <?php echo $data->query; ?>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="common  formElements" id="convertedUser_<?php echo $data->id; ?>" <?php if ($data->mail_sent == '') { ?> style="display:none;"<?php } ?>> 
            <div><label for="Send_a_msg_subject" style="float:left;margin: 3px 13px 2px 0px;">Converted</label>
                <input type="checkbox" name="convert" id="convert<?php echo $data->id; ?>" class="conver_class btn btn-default" <?php if ($data->is_converted == 1) { ?>checked="checked"  disabled="disabled" <?php } ?> data-bb="confirm" value="<?php echo $data->id; ?>"></div>
            <div class="clear"></div>
            <input type="button" value="Cancle" class="btnbook" onclick="return hideQuery('open_msg_box_<?php echo $data->id; ?>')" />
        </div>
        <div id="send_a_msg_box_<?php echo $data->id; ?>" style="margin: 9px 120px 0px 18px;<?php echo $display; ?>" class="sendMessageTouser">
            <div id="AjaxLoader_<?php echo $data->id; ?>" style="display:none;" align="center">&nbsp;<img src="<?php echo ThemePath(); ?>/images/fancybox_loading@2x.gif" align="absmiddle"></div>

            <div class="common  formElements"> 
                <input class="field oneCol" title="subject" name="subject" id="subject_<?php echo $data->id; ?>" type="hidden" value="Query generated: name of <?php if ($data->classes_id) echo "Class ".$data->classes->class_titile; if ($data->courses_id) echo "Course ".$data->courses->course_titile; ?> | User Name: <?php echo $data->name;?>">
                <div  class="errorMessage" id='errorMessage_subject_<?php echo $data->id; ?>'></div>
                <div class="clear"></div>
            </div>
            <div class="common formElements">
                <label for="send_a_msg_box_<?php echo $data->id; ?>">Write Message: <span class="required">*</span></label>
                <div class="clear"></div>
                <textarea  class=" requiredfield" id="message_text_<?php echo $data->id; ?>" name="message_text"></textarea>
                <div  class="errorMessage" id='errorMessage_msg_<?php echo $data->id; ?>'></div>
                <div class="clear"></div>
            </div>												

            <p class="alignR remmarginB">
                <input type="button" value="Cancle" class="btnbook" onclick="return hideQuery('open_msg_box_<?php echo $data->id; ?>')" />
                <input type="button" value="Submit" name="yt1" class="btnbook" onclick="return sendAMailToAllConvertedUser(<?php echo $data->id; ?>,<?php echo $data->classes_id; ?>,<?php echo $data->users_id; ?>,'<?php echo $classcoursetyp;
				?>')"></p>
        </div>
    </div>
    <div class="clear addmarginB20" ></div>
</div>
